/*
 * IndiceAgregacion.cpp
 *
 *  Created on: Jun 6, 2012
 *      Author: lucasj
 */

#include "IndiceAgregacion.h"

AggregationIndex::IndiceAgregacion::IndiceAgregacion() {


}

AggregationIndex::IndiceAgregacion::~IndiceAgregacion() {

}

bool AggregationIndex::IndiceAgregacion::estaVacia() {
	return this->mapa.empty();
}

void AggregationIndex::IndiceAgregacion::SetElem(const std::string dimension, const int valor, int posHecho) {
	if (this->mapa.empty()) {
		AggregationList::ListaAgregacion lista;
		lista.setElem(valor, posHecho);
		this->mapa.insert(std::pair<std::string, AggregationList::ListaAgregacion>(dimension, lista));
  } else this->mapa[dimension].setElem(valor, posHecho);
}

std::ostringstream& AggregationIndex::operator<<(std::ostringstream& oss, IndiceAgregacion& indice) {
	iteratorAgregacion it;
	for (it = indice.mapa.begin(); it != indice.mapa.end(); ++it) {
		oss << it->first;
		oss << it->second;
	}
	return oss;
}



